home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / basic / qbscr15.zip / REF.BAS < prev    next >
BASIC Source File  |  1989-09-01  |  37KB  |  850 lines

  1. '┌────────────────────────────────────────────────────────────────────────┐
  2. '│                                                                        │
  3. '│                             R E F . B A S                              │
  4. '│                                                                        │
  5. '│                   (C) Copyright 1989 by Tony Martin                    │
  6. '│                                                                        │
  7. '├────────────────────────────────────────────────────────────────────────┤
  8. '│                                                                        │
  9. '│  Author: Tony Martin                                                   │
  10. '│  Completion Date: September 1, 1989                                    │
  11. '│  Language: Microsoft QuickBASIC version 4.5                            │
  12. '│                                                                        │
  13. '├────────────────────────────────────────────────────────────────────────┤
  14. '│                                                                        │
  15. '│  The purpose of this program is to provide a computer-based reference  │
  16. '│  to the portions of the QBSCR Screen Routines that require frequent    │
  17. '│  lookups.  These section includes window types, frame types, explode   │
  18. '│  types, and clear screen modes.                                        │
  19. '│                                                                        │
  20. '├────────────────────────────────────────────────────────────────────────┤
  21. '│                                                                        │
  22. '│  Compile instructions:                                                 │
  23. '│                                                                        │
  24. '│  Load the file REF.BAS into QuickBASIC normally.  Then load in add-    │
  25. '│  ition the file QBSCR.BAS.  You can then save the whole deal so that   │
  26. '│  QuickBASIC will create an .MAK file for the program.  At this         │
  27. '│  point the program will run; either use Shift+F5 or compile to an      │
  28. '│  .EXE file.                                                            │
  29. '│                                                                        │
  30. '└────────────────────────────────────────────────────────────────────────┘
  31.  
  32. '┌────────────────────────────────────────────────────────────────────────┐
  33. '│  Load the necessary DECLARE statements for the QBSCR routines.         │
  34. '└────────────────────────────────────────────────────────────────────────┘
  35.  
  36. REM $INCLUDE: 'QBSCR.INC'
  37.  
  38. '┌────────────────────────────────────────────────────────────────────────┐
  39. '│  All other DECLARE statements.                                         │
  40. '└────────────────────────────────────────────────────────────────────────┘
  41.  
  42. DECLARE SUB BuildScreenModes ()
  43. DECLARE SUB ClrScrModes ()
  44. DECLARE SUB ExplodeTypes ()
  45. DECLARE SUB FrameTypes ()
  46. DECLARE SUB Main ()
  47. DECLARE SUB Quit ()
  48. DECLARE SUB WindowTypes ()
  49.  
  50. '┌────────────────────────────────────────────────────────────────────────┐
  51. '│  Declare global variables and constants.                               │
  52. '└────────────────────────────────────────────────────────────────────────┘
  53.  
  54. CONST FALSE = 0, TRUE = NOT FALSE
  55. COMMON SHARED marker$
  56. COMMON SHARED kolor
  57.  
  58. '┌────────────────────────────────────────────────────────────────────────┐
  59. '│  DIMension all necessary arrays.                                       │
  60. '└────────────────────────────────────────────────────────────────────────┘
  61.  
  62. DIM SHARED menuChoices$(6)
  63.  
  64. '┌────────────────────────────────────────────────────────────────────────┐
  65. '│  Determine whether or not the host machine has color capability.       │
  66. '│  This is accomplished via the QBSCR ColorChk function.  For more       │
  67. '│  detail, see the QBSCR documentation or the included SAMPLE program.   │
  68. '└────────────────────────────────────────────────────────────────────────┘
  69.  
  70. IF ColorChk THEN
  71.     kolor = TRUE
  72. ELSE
  73.     kolor = FALSE
  74. END IF
  75.  
  76. '┌────────────────────────────────────────────────────────────────────────┐
  77. '│  Call the function "Main."  This routine drives the entire program.    │
  78. '└────────────────────────────────────────────────────────────────────────┘
  79.  
  80. Main
  81.  
  82. '┌────────────────────────────────────────────────────────────────────────┐
  83. '│  Quit the REF program.                                                 │
  84. '└────────────────────────────────────────────────────────────────────────┘
  85.  
  86. Quit
  87. END
  88.  
  89. SUB BuildScreenModes
  90.  
  91. '┌────────────────────────────────────────────────────────────────────────┐
  92. '│  This sub-program runs through all the different modes that the        │
  93. '│  BuildScreen subroutine supports.  The user may press ESCape during    │
  94. '│  the pause to quit.                                                    │
  95. '└────────────────────────────────────────────────────────────────────────┘
  96.   
  97. '┌────────────────────────────────────────────────────────────────────────┐
  98. '│  Set colors to something with black background and clear the screen.   │
  99. '└────────────────────────────────────────────────────────────────────────┘
  100.  
  101. COLOR 7, 0
  102. CLS
  103.  
  104. '┌────────────────────────────────────────────────────────────────────────┐
  105. '│  Define the variable esc$ as the ASCII code for the ESCape character.  │
  106. '└────────────────────────────────────────────────────────────────────────┘
  107.   
  108. esc$ = CHR$(27)
  109.  
  110. '┌────────────────────────────────────────────────────────────────────────┐
  111. '│  Set the colors based on the value of the Kolor variable.  If Kolor is │
  112. '│  false, use monochrome colors.  If Kolor is true, use something more   │
  113. '│  interesting (in this case, Cyan on Black).  While we're here, we'll   │
  114. '│  also define the disk file containing the screen to display.           │
  115. '└────────────────────────────────────────────────────────────────────────┘
  116.   
  117. IF kolor THEN
  118.     windowForeColor% = 0     ' Black
  119.     windowBackColor% = 3     ' Cyan
  120.     inputForeColor% = 15     ' Bright White
  121.     inputBackColor% = 0      ' Black
  122.     screenFore% = 11         ' Bright Cyan
  123.     screenBack% = 0          ' Black
  124.     fillFore% = 9            ' Bright Blue
  125.     fillBack% = 0            ' Black
  126.     buildScreenFile$ = "TESTSCR.CLR"
  127. ELSE
  128.     windowForeColor% = 0     ' Black
  129.     windowBackColor% = 7     ' White
  130.     inputForeColor% = 15     ' Bright White
  131.     inputBackColor% = 0      ' Black
  132.     screenFore% = 15         ' Bright White
  133.     screenBack% = 0          ' Black
  134.     fillFore% = 7            ' White
  135.     fillBack% = 0            ' Black
  136.     buildScreenFile$ = "TESTSCR.MON"
  137. END IF
  138.  
  139. '┌────────────────────────────────────────────────────────────────────────┐
  140. '│  Let user input the mode they wish to see.  If ESC, then quit.         │
  141. '└────────────────────────────────────────────────────────────────────────┘
  142.  
  143. maxModes% = 15
  144. done% = FALSE
  145. DO
  146.  
  147.     '┌────────────────────────────────────────────────────────────────────┐
  148.     '│  Clear the screen.                                                 │
  149.     '└────────────────────────────────────────────────────────────────────┘
  150.  
  151.     COLOR 7, 0
  152.     CLS
  153.  
  154.     '┌────────────────────────────────────────────────────────────────────┐
  155.     '│  Make a window in the middle in which instructions will be placed. │
  156.     '└────────────────────────────────────────────────────────────────────┘
  157.  
  158.     MakeWindow 10, 30, 14, 50, windowForeColor%, windowBackColor%, 0, 0, -1, 0, ""
  159.   
  160.     '┌────────────────────────────────────────────────────────────────────┐
  161.     '│  Add some instructional text in the center window.                 │
  162.     '└────────────────────────────────────────────────────────────────────┘
  163.  
  164.     COLOR windowForeColor%, windowBackColor%
  165.     LOCATE 11, 32, 0: PRINT "Enter BuildScreen"
  166.     LOCATE 12, 33, 0: PRINT "Mode (0-"; LTRIM$(RTRIM$(STR$(maxModes%))); ")"
  167.     Center "<To QUIT hit ESC>", 13
  168.  
  169.     '┌────────────────────────────────────────────────────────────────────┐
  170.     '│  Get input from user via GetString function. Loop until valid.     │
  171.     '└────────────────────────────────────────────────────────────────────┘
  172.  
  173.     validNum